<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>v-for遍历对象</title>
  <script src="../js/vue.min.js"></script>
</head>

<body>
  <div id ="app"> 
    <!-- 1. 在遍历对象过程中,如果只是获取一个值,那么获取到的是value -->
    <ul>
      <li v-for="item in info">{{item}}</li>
    </ul>

    <!-- 2. 获取key和value -->
    <ul>
      <li v-for="(value,key) in info">{{value}}-{{key}}</li>
    </ul>

    <!-- 3. 获取key value index  格式:(value,key,index) -->
    <ul>
      <li v-for="(value,key,index) in info">{{index}}-{{key}}-{{value}}</li>
    </ul>

  </div>

  <script>
   var vm = new Vue({
    el: '#app',
    data: {
      info: {
        name: '小芳',
        age: 18,
        height: 185
      }
    },
    methods: {}
   });
  </script>
</body>

</html>